/**
 * @Question demo1
 * @Date 2022/10/16 22:43
 * @Solution
 */
class Person {
    public String name;
    public String address;
    public String phone;
    public String email;

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                '}';
    }
}
class Student extends Person {
    public String code;
    public String theClass;

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                '}';
    }
    public double area(Geometry[] g) {
        double sum=0;
        for(int i=0;i<g.length;i++) {
            sum+=g[i].getArea();
        }
        return sum;
    }
}
class Employee extends Person {
    public String code;
    public String post;

    @Override
    public String toString() {
        return "Employee{" +
                "name='" + name + '\'' +
                '}';
    }
}
class Undergraduate extends Student {
    public String major;

    @Override
    public String toString() {
        return "Undergraduate{" +
                "name='" + name + '\'' +
                '}';
    }
}
class Graduate extends Student {
    public String development;

    @Override
    public String toString() {
        return "Graduate{" +
                "name='" + name + '\'' +
                '}';
    }
}
public class demo1 {
    public static void main(String[] args) {
        Person person = new Person();
        Employee employee = new Employee();
        Student student = new Student();
        Undergraduate undergraduate = new Undergraduate();
        Graduate graduate = new Graduate();
        System.out.println(person.toString());
        System.out.println(employee.toString());
        System.out.println(student.toString());
        System.out.println(undergraduate.toString());
        System.out.println(graduate.toString());
    }
}
